<!doctype html>
<html>
  <head>
    <meta charset="UTF-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
    <title></title>
    <link rel="stylesheet" type="text/css" href="../css/api.css" />
    <link rel="stylesheet" type="text/css" href="../css/common.css" />    
    <style>     
     /* 头部样式 */
     .topbar {background: #3A8B7A; height:50px; border-bottom: 1px solid #DDDFE3; }
     #title { color:#FFF;} 
     .swipe {line-height: 50px;margin-right: 10px;color: #FF8400;}
     .back {float: left; padding-right: 30px;}
     .back img {height: 30px;margin-top: 10px;margin-left: 10px;margin-bottom: 10px;}
     .topbar .title {line-height: 50px; font-size: 22px; position: absolute; left: 50%; -webkit-transform: translateX(-50%);transform: translateX(-50%);}
     .right {float: right; padding-left: 30px;}
     .right img {height: 30px;margin-top: 10px;margin-right: 10px;margin-bottom: 10px;}  
    </style>
  </head>
  <body>
    <div id="wrap">
      <!-- 第一头部 -->
      <div id="header" class="titlebar activebar">
        <div class="topbar whitebar">
          <div class="back"  tapmode="" onclick="goback()"><img src="../image/btn/back.png" alt=""></div>
          <div class="title" id="title"></div>
          <div id="right" class="right"></div>
         </div>       
       </div>      
    </div>
  </body>
<script type="text/javascript" src="../script/api.js"></script>
<script type="text/javascript" src="../script/api.data.js"></script>
<script type="text/javascript" src="../script/jquery.md5.js"></script>
<script type="text/javascript" src="../script/jquery.min.js"></script>
  <script type="text/javascript">
  
    apiready = function(){     
           //获取头部和底部的相关信息，计算子窗口的高度及y坐标
           header = $api.byId('header');       
           $api.fixIos7Bar(header);     
           headerOffset = $api.offset(header);      
          //获取当前访问页面的名称，根据传递的类别值进行判断
          var category = api.pageParam.category;
      
          var height = 50;
          if(category == 'collection'){
              var title = "我的收藏";      
          }else if(category == "change_password"){
              var title = "修改密码"; 
          }else if(category == "search"){
              var title = "内容搜索"; 
          }else if(category == 'hot_spot'){
              var title = "热点追踪";        
          }else if(category == 'classification'){
              var title = "分类汇总"; 
                  height = 100;       
          }else if(category == 'analysis'){
              var title = "舆情分析";         
          }else if(category == 'bookReader'){
              var title = "文件阅读";     
          }
          //输出当前栏目名称
          document.getElementById("title").innerHTML = title;
          
         if("ios" == api.systemType && parseInt(api.systemVersion) >= 7){
             height = parseInt(height)+20;
          }
          
          //如果不是修改密码，则用统一列表窗口，否则调用修改密码窗口
          if(category == "change_password"){
               openChange(category,height);
          }else if(category == "search"){
               openSearch(category,height);
          }else{
               openUnified(category,height);
          }     
    }
    
    //打开统一子窗口
    function openUnified(category,height){
         //打开列表页
          api.openFrame ({
                name: "unifiedList",
                url: "./unifiedList.html",
                rect:{
                    x:0,
                    y:height,
                    w:api.frameWidth,
                    h:'auto'
                },
                delay: 300,
                pageParam: {category:category},
                vScrollBarEnabled:false,
                hScrollBarEnabled:true,
                bounces: false,
                delay:200
          });     
    }
    
    
    /***搜索窗口****/
    function openSearch(category,height){
         api.openFrame ({
                name: "searchFrame",
                url: "./searchFrame.html",
                rect:{
                    x:0,
                    y:height,
                    w:api.frameWidth,
                    h:'auto'
                },
                delay: 300,             
                vScrollBarEnabled:false,
                hScrollBarEnabled:true,
                bounces: false,
                delay:200
          });
    }
    
    
    /***修改密码窗口****/
    function openChange(category,height){       
          api.openFrame ({
                name: "changeFrame",
                url: "./changeFrame.html",
                rect:{
                    x:0,
                    y:height,
                    w:api.frameWidth,
                    h:'auto'
                },
                delay: 300,             
                vScrollBarEnabled:false,
                hScrollBarEnabled:true,
                bounces: false,
                delay:200
          });
    }
  
    function goback () {
      api.closeWin({name:'unifiedWin'});
    }
    
   
  </script>
</html>